#ifndef FRIENDWINDOW_H
#define FRIENDWINDOW_H

#include <QWidget>
#include<QTextEdit>
#include<QListWidget>
#include<QLineEdit>
#include<QPushButton>
#include<QVBoxLayout>
#include<QHBoxLayout>
#include"protocol.h"
#include"addfriend.h"


namespace Ui {
class FriendWindow;
}

class FriendWindow : public QWidget
{
    Q_OBJECT

public:
    explicit FriendWindow(QWidget *parent = nullptr);
    ~FriendWindow();
    void setOnlineUsers(PDU* pdu);
    void updateFriendList(PDU* pdu);
    void sayFriendList(PDU* pdu);
    void setChatName(QString strName);
    QString strLoginName() const;
    void setStrLoginName(const QString &strLoginName);
    static FriendWindow &getInstance();

private:
    addfriend *m_paddUserW;

    QString m_setChatName;
    QString m_strLoginName;
    QString m_caOnline;

    QMenu *popMenu_In_ListWidget_;
    QAction *action_Delete_In_ListWidget_;
    QAction *action_Clear_In_ListWidget_;

     Ui::FriendWindow *ui;
public slots:

private slots:
    void on_m_addFriendPB_clicked();
    void on_friend_pb_clicked();
    void onCustomContextMenuRequested(const QPoint &pos);
    void deleteFriend();
    void onFriendDoubleClicked(QListWidgetItem *item);
    void on_sendMsg_pb_clicked();

};

#endif // FRIENDWINDOW_H
